﻿<Window x:Class="MainWindow" x:Name="mw1" AllowDrop="True" Drop="Grid_Drop"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="MainWindow" Height="500" Width="750">
    <Grid Drop="Grid_Drop" AllowDrop="True">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <StackPanel Orientation="Vertical">
            <TextBlock>
                Asd
            </TextBlock>
        </StackPanel>

        <DockPanel Grid.Row="1">
            <Button Name="btPickFiles" Content="Pick files..." Click="btPickFiles_Click" Margin="3" DockPanel.Dock="Right" MinWidth="150" MinHeight="30"/>
            <TextBlock Text="Drag and drop files to tag on the application, or use the button to select files manually" Margin="3" VerticalAlignment="Center"/>
        </DockPanel>
        

        <GroupBox Header="Static Tags" Margin="3" Grid.Row="2">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="100" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <CheckBox x:Name="cbArtist" VerticalAlignment="Center" Content="Artist" Margin="3" Grid.Row="0"/>
                <CheckBox x:Name="cbAlbum" VerticalAlignment="Center" Content="Album" Margin="3" Grid.Row="1"/>
                <CheckBox x:Name="cbYear" VerticalAlignment="Center" Content="Year" Margin="3" Grid.Row="2"/>

                <TextBox x:Name="tbArtist" Margin="3" Grid.Column="1" IsEnabled="{Binding ElementName=cbArtist, Path=IsChecked}"/>
                <TextBox x:Name="tbAlbum" Margin="3" Grid.Column="1" Grid.Row="1" IsEnabled="{Binding ElementName=cbAlbum, Path=IsChecked}"/>
                <TextBox x:Name="tbYear" Margin="3" Grid.Column="1" Grid.Row="2" IsEnabled="{Binding ElementName=cbYear, Path=IsChecked}"/>
            </Grid>
        </GroupBox>

        <Grid  Grid.Row="3">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>

            <GroupBox Header="Data" Margin="3">
                <DataGrid Name="dg1" AutoGenerateColumns="False" CanUserAddRows="False" ItemsSource="{Binding ElementName=mw1, Path=Tags}">
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Filename}" Header="File Name" Width="*"/>
                        <DataGridTextColumn Binding="{Binding Title}" Header="Title" Width="*"/>
                        <DataGridTextColumn Binding="{Binding Artist}" Header="Artist" Width="*"/>
                        <DataGridTextColumn Binding="{Binding Album}" Header="Album" Width="*"/>
                        <DataGridTextColumn Binding="{Binding Track}" Header="Track number" Width="*"/>
                        <DataGridTextColumn Binding="{Binding Year}" Header="Year" Width="*"/>
                    </DataGrid.Columns>
                </DataGrid>
            </GroupBox>

            <GroupBox Header="Paste Tracklist Here" Margin="3" Grid.Column="1">
                <TextBox Margin="3" Name="tbInput"></TextBox>
            </GroupBox>
        </Grid>


        <GroupBox Header="Formula" Grid.Row="4" Margin="3">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                
                <TextBox Name="tbFormula" Margin="3" Grid.ColumnSpan="5" />
                <Button Content="%artist%" Grid.Column="0" Grid.Row="1" Margin="3" Click="btFormulaComponent_Click"/>
                <Button Content="%album%" Grid.Column="1" Grid.Row="1" Margin="3" Click="btFormulaComponent_Click"/>
                <Button Content="%title%" Grid.Column="2" Grid.Row="1" Margin="3" Click="btFormulaComponent_Click"/>
                <Button Content="%track%" Grid.Column="3" Grid.Row="1" Margin="3" Click="btFormulaComponent_Click"/>
                <Button Content="%year%" Grid.Column="4" Grid.Row="1" Margin="3" Click="btFormulaComponent_Click"/>
            </Grid>
        </GroupBox>

        <Grid Grid.Row="5">
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Button Name="btCompute" Margin="3" Content="Compute"  Click="btCompute_Click"/>
            <Button Content="Write tags" Name="btSaveTags" Click="btSaveTags_Click" Grid.Column="1" Margin="3"/>
        </Grid>
        
    </Grid>
</Window>
